#!/usr/local/bin/env python3.7
# from  numba import jit
import req
import tkinter
from tkinter import *
from PIL import Image,ImageTk
# img = req.yanzhengma
def hello():
       print("hello你阿訇")
def main():
    window = tkinter.Tk()
    # 标题
    window.title('请输入验证码')
    # 长 宽
    x = 500
    y = 300
    # 获取屏幕尺寸计算布局，使窗口居中
    screenwidth = window.winfo_screenwidth()
    screenheight = window.winfo_screenheight()
    alignstr = '%dx%d+%d+%d' % (x, y, (screenwidth-x)/2, (screenheight-y)/2)
    # 绘制窗口
    window.geometry(alignstr)
    # 处理图片
    ima_ge = Image.open('ls.jpg')
    image_file = ImageTk.PhotoImage(ima_ge)
    # 显示图片
    imLal = tkinter.Label(window,image=image_file).pack()
    # 显示输入框
    w = tkinter.Entry(window,width=50,fg='black')
    w.pack()
    shurukuang_neirong = w.get()
    print(shurukuang_neirong)
    yanzheng = req.yanzheng
    # yanzheng = 5005
    
    print('这是'+yanzheng)
    zhuce = req.denglu_post
   
    # 显示确认按钮
    o  =  tkinter.Button(window,command=zhuce,text='确认').pack()
    # 文本框
    t = tkinter.Text(window,height=500,width=100)
    t.pack()
    t.insert(END, 'hellp\n')    # image = canvas.create_image(90,43,anchor='n',image=image_file)
    t.insert(INSERT,req.toke)
    t.image_create(INSERT,image=image_file)
    window.mainloop()
if  __name__ == "__main__":
    # req.yanzhenma()
    # t.insert(END,'不回家')
    main()
    
